/**
 * 
 */
package it.unibo.refolding.pico;

import java.awt.Shape;
import java.awt.geom.Line2D;
import java.util.ArrayList;
import java.util.List;

public abstract class AbstractDirectionData extends DirectionData {
	public AbstractDirectionData(short[] deflection, short[] z) {
		super(deflection, z);
	}

	public abstract List<Shape> draw(double svgDefScale);

	@Override
	public abstract AbstractDirectionData subRange(int from, int to);

	public List<Shape> drawRawSegment(int from, int to, double svgDefScale) {
		List<Shape> result = new ArrayList<Shape>(to - from);
		for (int i = from; i < to - 1; ++i) {
			Shape line = new Line2D.Double(z[i], deflection[i] * svgDefScale, z[i + 1], deflection[i + 1] * svgDefScale);
			result.add(line);
		}
		return result;
	}
}
